import 'package:get/get.dart';

enum DeviceType {
  dlsL("DLS_L"),
  dlsR("DLS_R"),
  axocc("AXOcc"),
  axo("AXO"),
  apm2("APM2"),
  axpower("AXPOWER"),
  hiflow("HIFLOW"),
  jtL("JT_L"),
  jrR("JT_R"),
  unknow("unknow");

  final String prefix;

  const DeviceType(this.prefix);

  static DeviceType fromDeviceName(String name) {
    final type = DeviceType.values
        .firstWhereOrNull((test) => name.startsWith(test.prefix));
    return type ?? DeviceType.unknow;
  }
}
